package se.mbaeumer.fxtodo.core.handler;

import java.sql.SQLException;
import java.util.List;

import se.mbaeumer.fxtodo.core.model.EnumICSInfoType;
import se.mbaeumer.fxtodo.core.model.ICSInfo;
import se.mbaeumer.fxtodo.db.DatabaseHandler;

public class ICSInfoHandler {
	private static final ICSInfoHandler INSTANCE = 
			new ICSInfoHandler();
	private ICSInfoHandler() {};
	public static ICSInfoHandler getInstance(){return INSTANCE;}

	public void createICSInfo(DatabaseHandler dbh, ICSInfo ics) throws SQLException{
		dbh.createICSInfo(ics);
	}
	
	public ICSInfo getICSInfoByTaskID(DatabaseHandler dbh, int taskId){
		return dbh.getICSInfoByTaskID(taskId);
	}
	
	public List<ICSInfo> getICSInfo(DatabaseHandler dbh){
		return dbh.getICSInfos();
	}
	
	public EnumICSInfoType getICSInfoTypeByName(DatabaseHandler dbh, String name){
		return dbh.getICSInfoTypeByName(name);
	}
	
	public void deleteICSInfos(DatabaseHandler dbh){
		dbh.deleteICSInfos();
	}
	
	public void importICSInfoFromXML(DatabaseHandler dbh, ICSInfo icsInfo) throws SQLException{
		dbh.importICSInfoFromXML(icsInfo);
	}
}
